.\" This man page is Copyright (C) 2003, 2010 Lennert Buytenhek.
.\" Permission is granted to distribute possibly modified copies
.\" of this page provided the header is included verbatim,
.\" and in case of nontrivial modification author and date
.\" of the modification is added to the header.
.TH iv_init 3 2010-09-05 "ivykis" "ivykis programmer's manual"
.SH NAME
iv_init, iv_deinit, iv_inited \- initialise and deinitialise ivykis
.SH SYNOPSIS
.B #include <iv.h>
.sp
.BI "void iv_init(void);"
.br
.BI "void iv_deinit(void);"
.br
.BI "int iv_inited(void);"
.br
.SH DESCRIPTION
.B iv_init
initialises the current thread's ivykis event loop.
.PP
Each thread that wants to use ivykis must call
.B iv_init
before any other ivykis functions are called.
.PP
The very first call to
.B iv_init
in a process must run to completion before other threads are allowed
to call
.B iv_init,
but subsequent calls to
.B iv_init
can be done concurrently.
.PP
.B iv_deinit
frees all resources allocated by ivykis in this thread, and should be
called before this thread exits.
.PP
.B iv_inited
returns true if
.B iv_init
has been called in this thread.  After
.B iv_deinit
is called, it will return false.
.SH "SEE ALSO"
.BR ivykis (3),
.BR iv_examples (3)
